home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / 2.11news / patch01 < prev    next >
Encoding:
Text File  |  1986-11-30  |  56.5 KB  |  2,274 lines

  1. /* Written  6:15 pm  Nov 21, 1986 by rick@seismo.UUCP in mirror:news.software.b */
  2. /* ---------- "Patch #1 for news 2.11 source" ---------- */
  3. Description:
  4.     This is patch #1 for news 2.11 source. It addresses the following
  5.     problems:
  6.  
  7.     vnews/readnews does not correctly identify when an article has
  8.     been cancelled.
  9.     vnews redraws the screen twice on ^Z.
  10.     followups from readnews incorrectly seperate references with ",".
  11.     The options line to vnews/readnews can only be BUFSIZ chars long.
  12.     logerr() in batch/unbatch mishandles arguments on machines with
  13.     16bit ints and 32 bit char *.
  14.     There was no way to have moderated local groups.
  15.     The test for included text should be more generous.
  16.     The code to make directories on USG machines was not quite correct.
  17.     System 5 machines with the broken stdio couldn't process newgroup
  18.     control messages correctly.
  19.     You couldn't use LOCKF with BSD4_2. (e.g. Ultrix).
  20.     You couldn't specify the complete domain name with gethostbyname
  21.     and set MYDOMAIN to "".
  22.     uurec core dumped in certain cases.
  23.     getdate() didn't handle timezones of +-HHMM quite right.
  24.     getdate() cared what case the month and day of week was.
  25.     postnews didn't understand the new newsgroup names very well.
  26.     (It still doesn't handle distributions very well. Next patch...)
  27.     checkgroups didn't work on machines with 14 character file names.
  28.     The makefile line with #NOTVMS screwed up some makes.
  29.     The HIDDENNET code didn't quite figure out its own hostname when
  30.     forwarding articles.
  31.     MULTICASTING was broken with addition of the I flag.
  32.     A line was written into the history file twice in some cases.
  33.     Various cosmetic changes.
  34.  
  35. Fix:
  36.     cd to the src directory and apply the following patch
  37.  
  38. Index: visual.c
  39. Prereq: 1.32
  40. *** .d/visual.c    Thu Oct 30 16:08:02 1986
  41. --- visual.c    Fri Nov 21 14:05:26 1986
  42. ***************
  43. *** 4,10 ****
  44.    */
  45.   
  46.   #ifdef SCCSID
  47. ! static char    *SccsId = "@(#)visual.c    1.32    10/23/86";
  48.   #endif /* SCCSID */
  49.   
  50.   #include "rparams.h"
  51. --- 4,10 ----
  52.    */
  53.   
  54.   #ifdef SCCSID
  55. ! static char    *SccsId = "@(#)visual.c    1.33    11/21/86";
  56.   #endif /* SCCSID */
  57.   
  58.   #include "rparams.h"
  59. ***************
  60. *** 793,799 ****
  61.               *ptr2 = '\0';
  62.           ptr2 = index(ptr3, '/');
  63.           if (!ptr2) {
  64. !             if (strcmp(++ptr3, "cancelled") == 0)
  65.                   msg("%s has been cancelled", linebuf);
  66.               else
  67.                   msg("%s has expired", linebuf);
  68. --- 793,799 ----
  69.               *ptr2 = '\0';
  70.           ptr2 = index(ptr3, '/');
  71.           if (!ptr2) {
  72. !             if (strcmp(ptr3, "cancelled") == 0)
  73.                   msg("%s has been cancelled", linebuf);
  74.               else
  75.                   msg("%s has expired", linebuf);
  76. ***************
  77. *** 2436,2444 ****
  78.       ttyraw();
  79.   #ifdef TIOCGWINSZ
  80.       winch();    /* get current window size and redraw screen */
  81. ! #endif     /* TIOCGWINSZ */
  82.       clearok(curscr, 1);
  83.       updscr();
  84.   #ifdef BSD4_2
  85.       (void) sigsetmask(sigblock(0) & ~(sigmask(SIGALRM)|sigmask(SIGINT)));
  86.   #else /* BSD4_1 */
  87. --- 2436,2445 ----
  88.       ttyraw();
  89.   #ifdef TIOCGWINSZ
  90.       winch();    /* get current window size and redraw screen */
  91. ! #else     /* !TIOCGWINSZ */
  92.       clearok(curscr, 1);
  93.       updscr();
  94. + #endif     /* !TIOCGWINSZ */
  95.   #ifdef BSD4_2
  96.       (void) sigsetmask(sigblock(0) & ~(sigmask(SIGALRM)|sigmask(SIGINT)));
  97.   #else /* BSD4_1 */
  98.  
  99. Index: iparams.h
  100. Prereq: 2.16
  101. *** .d/iparams.h    Thu Oct 30 16:12:13 1986
  102. --- iparams.h    Fri Nov 21 14:05:11 1986
  103. ***************
  104. *** 2,10 ****
  105.    * iparams - parameters for inews.
  106.    */
  107.   
  108. ! /*    @(#)iparams.h    2.16    10/23/86    */
  109.   
  110.   #include "params.h"
  111.   
  112.   /* external declarations specific to inews */
  113.   extern    char    nbuf[LBUFLEN], *ARTICLE, *INFILE, *ALIASES, *PARTIAL;
  114. --- 2,12 ----
  115.    * iparams - parameters for inews.
  116.    */
  117.   
  118. ! /*    @(#)iparams.h    2.17    11/21/86    */
  119.   
  120.   #include "params.h"
  121. + #include <errno.h>
  122. + extern int errno;
  123.   
  124.   /* external declarations specific to inews */
  125.   extern    char    nbuf[LBUFLEN], *ARTICLE, *INFILE, *ALIASES, *PARTIAL;
  126.  
  127. Index: readr.c
  128. Prereq: 2.58
  129. *** .d/readr.c    Thu Oct 30 16:09:49 1986
  130. --- readr.c    Fri Nov 21 14:05:19 1986
  131. ***************
  132. *** 16,22 ****
  133.    */
  134.   
  135.   #ifdef SCCSID
  136. ! static char    *SccsId = "@(#)readr.c    2.58    10/23/86";
  137.   #endif /* SCCSID */
  138.   
  139.   #include "rparams.h"
  140. --- 16,22 ----
  141.    */
  142.   
  143.   #ifdef SCCSID
  144. ! static char    *SccsId = "@(#)readr.c    2.59    11/21/86";
  145.   #endif /* SCCSID */
  146.   
  147.   #include "rparams.h"
  148. ***************
  149. *** 517,523 ****
  150.           ptr2 = index(ptr3, '/');
  151.           if (!ptr2) {
  152.               *ptr3 = '\0';
  153. !             if (strcmp(++ptr3, "cancelled") == 0) {
  154.                   fprintf(ofp, "Article %s has been cancelled.\n",
  155.                       bptr);
  156.                   break;
  157. --- 517,523 ----
  158.           ptr2 = index(ptr3, '/');
  159.           if (!ptr2) {
  160.               *ptr3 = '\0';
  161. !             if (strcmp(ptr3, "cancelled") == 0) {
  162.                   fprintf(ofp, "Article %s has been cancelled.\n",
  163.                       bptr);
  164.                   break;
  165. ***************
  166. *** 579,585 ****
  167.                   (void) strcpy(bfr, groupdir);
  168.                   selectng(ogroupdir, FALSE, PERHAPS);
  169.                   set(oobit);
  170. !                 fprintf(ofp,"Holding article %ld newsgroup %s\n", oobit, ogroupdir),
  171.                   (void) strcpy(groupdir, ogroupdir);
  172.                   selectng(bfr, FALSE, FALSE);
  173.                   bit = i;
  174. --- 579,586 ----
  175.                   (void) strcpy(bfr, groupdir);
  176.                   selectng(ogroupdir, FALSE, PERHAPS);
  177.                   set(oobit);
  178. !                 fprintf(ofp,"Holding article %ld newsgroup %s\n"
  179. !                     ,oobit, ogroupdir);
  180.                   (void) strcpy(groupdir, ogroupdir);
  181.                   selectng(bfr, FALSE, FALSE);
  182.                   bit = i;
  183. ***************
  184. *** 729,735 ****
  185.               fbp = index(fbp + 1, '<');
  186.           if (fbp != NULL) {
  187.               (void) strcpy(folbuf, fbp);
  188. !             (void) strcat(folbuf, ", ");
  189.           }
  190.       }
  191.       (void) strcat(folbuf, hptr->ident);
  192. --- 730,736 ----
  193.               fbp = index(fbp + 1, '<');
  194.           if (fbp != NULL) {
  195.               (void) strcpy(folbuf, fbp);
  196. !             (void) strcat(folbuf, " ");
  197.           }
  198.       }
  199.       (void) strcat(folbuf, hptr->ident);
  200.  
  201. Index: process.c
  202. Prereq: 2.15
  203. *** .d/process.c    Thu Oct 30 16:16:54 1986
  204. --- process.c    Fri Nov 21 14:05:17 1986
  205. ***************
  206. *** 16,26 ****
  207.    */
  208.   
  209.   #ifdef SCCSID
  210. ! static char    *SccsId = "@(#)process.c    2.15    9/16/86";
  211.   #endif /* SCCSID */
  212.   
  213.   #include "rparams.h"
  214.   
  215.   #define OPTION    0    /* pick up an option string */
  216.   #define STRING    1    /* pick up a string of arguments */
  217.   
  218. --- 16,29 ----
  219.    */
  220.   
  221.   #ifdef SCCSID
  222. ! static char    *SccsId = "@(#)process.c    2.16    11/21/86";
  223.   #endif /* SCCSID */
  224.   
  225.   #include "rparams.h"
  226.   
  227. + char    coptbuf[LBUFLEN], datebuf[LBUFLEN];
  228. + struct hbuf header;
  229.   #define OPTION    0    /* pick up an option string */
  230.   #define STRING    1    /* pick up a string of arguments */
  231.   
  232. ***************
  233. *** 55,61 ****
  234.       register int state = STRING;
  235.       register char *ptr = header.nbuf;
  236.       char filchar = NGDELIM;
  237. !     int len = BUFLEN, tlen;
  238.   
  239.       /* loop once per arg. */
  240.   
  241. --- 58,64 ----
  242.       register int state = STRING;
  243.       register char *ptr = header.nbuf;
  244.       char filchar = NGDELIM;
  245. !     int len = LBUFLEN, tlen;
  246.   
  247.       /* loop once per arg. */
  248.   
  249. ***************
  250. *** 92,98 ****
  251.               optpt->flag = TRUE;
  252.               state = optpt->newstate;
  253.               ptr = optpt->buf;
  254. !             len = BUFLEN;
  255.           }
  256.   
  257.           argv++;        /* done with this option arg. */
  258. --- 95,101 ----
  259.               optpt->flag = TRUE;
  260.               state = optpt->newstate;
  261.               ptr = optpt->buf;
  262. !             len = LBUFLEN;
  263.           }
  264.   
  265.           argv++;        /* done with this option arg. */
  266.  
  267. Index: batch.c
  268. Prereq: 1.15
  269. *** .d/batch.c    Thu Oct 30 16:16:52 1986
  270. --- batch.c    Fri Nov 21 14:04:58 1986
  271. ***************
  272. *** 32,38 ****
  273.    */
  274.   
  275.   #ifdef SCCSID
  276. ! static char    *SccsId = "@(#)batch.c    1.15    1/17/86";
  277.   #endif /* SCCSID */
  278.   
  279.   #include <stdio.h>
  280. --- 32,38 ----
  281.    */
  282.   
  283.   #ifdef SCCSID
  284. ! static char    *SccsId = "@(#)batch.c    1.17    11/21/86";
  285.   #endif /* SCCSID */
  286.   
  287.   #include <stdio.h>
  288. ***************
  289. *** 171,176 ****
  290. --- 171,177 ----
  291.   /* VARARGS1 */
  292.   logerror(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
  293.   char *fmt;
  294. + long a1, a2, a3, a4, a5, a6, a7, a8, a9;
  295.   {
  296.       FILE *logfile;
  297.       char lfname[BUFLEN];        /* the log file */
  298.  
  299. Index: inews.c
  300. Prereq: 2.69
  301. *** .d/inews.c    Thu Oct 30 16:08:50 1986
  302. --- inews.c    Fri Nov 21 14:05:10 1986
  303. ***************
  304. *** 17,23 ****
  305.    */
  306.   
  307.   #ifdef SCCSID
  308. ! static char    *SccsId = "@(#)inews.c    2.69    10/30/86";
  309.   #endif /* SCCSID */
  310.   
  311.   #include "iparams.h"
  312. --- 17,23 ----
  313.    */
  314.   
  315.   #ifdef SCCSID
  316. ! static char    *SccsId = "@(#)inews.c    2.70    11/21/86";
  317.   #endif /* SCCSID */
  318.   
  319.   #include "iparams.h"
  320. ***************
  321. *** 530,537 ****
  322.        * Only certain users are allowed to create newsgroups
  323.        */
  324.       if (uid != ROOTID && uid != duid && uid) {
  325. !         fprintf(stderr, "Please contact one of the local netnews people\n\tto create this group for you");
  326. !         xxit(1);
  327.       }
  328.       if (header.distribution[0] == '\0')
  329.   #ifdef ORGDISTRIB
  330. --- 530,537 ----
  331.        * Only certain users are allowed to create newsgroups
  332.        */
  333.       if (uid != ROOTID && uid != duid && uid) {
  334. !         logerr("Please contact one of the local netnews people");
  335. !         xerror("to create group \"%s\" for you", header.ctlmsg);
  336.       }
  337.       if (header.distribution[0] == '\0')
  338.   #ifdef ORGDISTRIB
  339. ***************
  340. *** 648,653 ****
  341. --- 648,658 ----
  342.           (void) rewind(actfp);
  343.   
  344.       (void) fseek(actfp, fpos, 0);
  345. +     /*
  346. +      * Has to be same size as old because of %05d.
  347. +      * This will overflow with 99999 articles.
  348. +      */
  349. +     fprintf(actfp, "%s %05ld", ngname, ngsize+1);
  350.   #ifdef USG
  351.       /*
  352.        * U G L Y   K L U D G E
  353. ***************
  354. *** 662,671 ****
  355.        */
  356.        actfp->_flag |= _IOWRT;
  357.   #endif /* USG */
  358. -     /* Has to be same size as old because of %05d.
  359. -      * This will overflow with 99999 articles.
  360. -      */
  361. -     fprintf(actfp, "%s %05ld", ngname, ngsize+1);
  362.       (void) fflush(actfp);
  363.       if (ferror(actfp))
  364.           xerror("Active file write failed");
  365. --- 667,672 ----
  366. ***************
  367. *** 765,776 ****
  368.           sprintf(bfr, "%s/mailpaths", LIBDIR);
  369.           mfd = xfopen(bfr, "r");
  370.           do {
  371. !             if (fgets(bfr, sizeof bfr, mfd) == NULL)
  372.                   xerror("Can't find backbone in %s/mailpaths",
  373.                       LIBDIR);
  374. !         } while (!prefix(bfr, "backbone"));
  375. !         if (sscanf(bfr, "%*s %s", modadd) != 1)
  376. !             xerror("backbone address corrupted");
  377.           /* fake a header for mailhdr */
  378.           mhdr.from[0] = '\0';
  379.           mhdr.replyto[0] = '\0';
  380. --- 766,776 ----
  381.           sprintf(bfr, "%s/mailpaths", LIBDIR);
  382.           mfd = xfopen(bfr, "r");
  383.           do {
  384. !             if (fscanf(mfd, "%s %s", bfr, modadd) != 2)
  385.                   xerror("Can't find backbone in %s/mailpaths",
  386.                       LIBDIR);
  387. !         } while (strcmp(bfr, "backbone") != 0 && !ngmatch(is_mod, bfr));
  388. !         (void) fclose(mfd);
  389.           /* fake a header for mailhdr */
  390.           mhdr.from[0] = '\0';
  391.           mhdr.replyto[0] = '\0';
  392. ***************
  393. *** 942,952 ****
  394.           }
  395.           if (bfr[0] == '>')
  396.               linserted++;
  397.           empty = FALSE;
  398.       }
  399.       if (*filename)
  400.           (void) fclose(infp);
  401. !     if (mode != PROC && linserted > (linecount-linserted))
  402.           error("Article rejected: %s included more text than new text",
  403.               username);
  404.   
  405. --- 942,955 ----
  406.           }
  407.           if (bfr[0] == '>')
  408.               linserted++;
  409. +         if (bfr[0] == '<') /* kludge to allow diff's to be posted */
  410. +             linserted--;
  411.           empty = FALSE;
  412.       }
  413.       if (*filename)
  414.           (void) fclose(infp);
  415. !     if (mode != PROC &&
  416. !         linecount > LNCNT && linserted > (linecount-linserted))
  417.           error("Article rejected: %s included more text than new text",
  418.               username);
  419.   
  420. ***************
  421. *** 1042,1096 ****
  422.   char    *fulldir;
  423.   char    *ngname;
  424.   {
  425. - #ifdef USG
  426. -     register char *p;
  427. -     char parent[200];
  428. -     char sysbuf[200];
  429. -     struct stat sbuf;
  430. - #endif /* USG */
  431.       if (ngname == NULL || !isalpha(ngname[0]))
  432.           xerror("Tried to make illegal newsgroup %s", ngname);
  433.   
  434. - #ifdef USG
  435. -     /*
  436. -      * If the parent is 755 the setuid(getuid)
  437. -      * will fail, and since mkdir is suid, and our real uid is random,
  438. -      * the mkdir will fail.  So we have to temporarily chmod it to 777.
  439. -      */
  440. -     (void) strcpy(parent, fulldir);
  441. -     while (p = rindex(parent, '/')) {
  442. -         *p = '\0';
  443. -         if (stat(parent, &sbuf) == 0) {
  444. -             (void) chmod(parent, 0777);
  445. -             break;
  446. -         }
  447. -     }
  448. - #endif /* USG */
  449.       /* Create the directory */
  450.       mkparents(fulldir);
  451.       if (mkdir(fulldir, 0777) < 0)
  452.           xerror("Cannot mkdir %s: %s", fulldir, errmsg(errno));
  453. - #ifdef USG
  454. -     (void) chmod(parent, (int)sbuf.st_mode);    /* put it back */
  455. -     /*
  456. -      * Give away the directories we just created which were assigned
  457. -      * our real uid.
  458. -      */
  459. -     (void) setuid(uid);
  460. -     (void) chown(fulldir, duid, dgid);
  461. -     (void) strcpy(sysbuf, fulldir);
  462. -     while (p = rindex(sysbuf, '/')) {
  463. -         *p = '\0';
  464. -         /* stop when get to last known good parent */
  465. -         if (strcmp(sysbuf, parent) == 0)
  466. -             break;
  467. -         (void) chown(sysbuf, duid, dgid);
  468. -     }
  469. -     (void) setuid(duid);
  470. - #endif /* USG */
  471.   
  472.       log("make newsgroup %s in dir %s", ngname, fulldir);
  473.   }
  474. --- 1045,1058 ----
  475.   char    *fulldir;
  476.   char    *ngname;
  477.   {
  478.       if (ngname == NULL || !isalpha(ngname[0]))
  479.           xerror("Tried to make illegal newsgroup %s", ngname);
  480.   
  481.       /* Create the directory */
  482.       mkparents(fulldir);
  483.       if (mkdir(fulldir, 0777) < 0)
  484.           xerror("Cannot mkdir %s: %s", fulldir, errmsg(errno));
  485.   
  486.       log("make newsgroup %s in dir %s", ngname, fulldir);
  487.   }
  488.  
  489. Index: checknews.c
  490. Prereq: 2.25
  491. *** .d/checknews.c    Thu Oct 30 16:11:17 1986
  492. --- checknews.c    Fri Nov 21 14:36:10 1986
  493. ***************
  494. *** 16,22 ****
  495.    */
  496.   
  497.   #ifdef SCCSID
  498. ! static char    *SccsId = "@(#)checknews.c    2.25    5/27/86";
  499.   #endif /* SCCSID */
  500.   
  501.   char *Progname = "checknews";        /* used by xerror */
  502. --- 16,22 ----
  503.    */
  504.   
  505.   #ifdef SCCSID
  506. ! static char    *SccsId = "@(#)checknews.c    2.26    11/21/86";
  507.   #endif /* SCCSID */
  508.   
  509.   char *Progname = "checknews";        /* used by xerror */
  510. ***************
  511. *** 31,38 ****
  512.   char    narggrp[BUFLEN];        /* spec newsgroup        */
  513.   FILE    *rcfp, *actfp;
  514.   char    newsrc[BUFLEN],*rcline[LINES],rcbuf[LBUFLEN],*argvrc[LINES];
  515. - struct hbuf header;
  516. - char    coptbuf[BUFLEN],datebuf[BUFLEN];
  517.   int    mode = 1;
  518.   #ifndef SHELL
  519.   char    *SHELL;
  520. --- 31,36 ----
  521.  
  522. Index: control.c
  523. Prereq: 2.48
  524. *** .d/control.c    Thu Oct 30 16:09:26 1986
  525. --- control.c    Fri Nov 21 14:36:09 1986
  526. ***************
  527. *** 19,25 ****
  528.    */
  529.   
  530.   #ifdef SCCSID
  531. ! static char    *SccsId = "@(#)control.c    2.48    10/30/86";
  532.   #endif /* SCCSID */
  533.   
  534.   #include "iparams.h"
  535. --- 19,25 ----
  536.    */
  537.   
  538.   #ifdef SCCSID
  539. ! static char    *SccsId = "@(#)control.c    2.48    11/21/86";
  540.   #endif /* SCCSID */
  541.   
  542.   #include "iparams.h"
  543. ***************
  544. *** 188,194 ****
  545.           inpos = ftell(infp);
  546.           while (ftell(infp) < outpos) {
  547.               if (fgets(myid, sizeof myid, infp) != myid)
  548. !                 error("iline: Can't rerear article");
  549.               myid[strlen(myid) - 1] = '\0';
  550.               if (findhist(myid) == NULL)
  551.                   (void) fprintf(outfp, "%s\n", myid);
  552. --- 188,194 ----
  553.           inpos = ftell(infp);
  554.           while (ftell(infp) < outpos) {
  555.               if (fgets(myid, sizeof myid, infp) != myid)
  556. !                 error("iline: Can't reread article");
  557.               myid[strlen(myid) - 1] = '\0';
  558.               if (findhist(myid) == NULL)
  559.                   (void) fprintf(outfp, "%s\n", myid);
  560. ***************
  561. *** 221,226 ****
  562. --- 221,227 ----
  563.       ** What else of this kind should be done?
  564.       */
  565.       header.organization[0] = header.distribution[0] = '\0';
  566. +     header.numlines[0] = '\0';
  567.       for (i = 0; i < NUNREC && header.unrec[i] != NULL; ++i) {
  568.           free(header.unrec[i]);
  569.           header.unrec[i] = NULL;
  570. ***************
  571. *** 418,438 ****
  572.                * group. Rewrite the active file
  573.                */
  574.               (void) fseek(actfp, -2L, 1); /* back up 2 characters */
  575. - #ifdef USG
  576. -             /*
  577. -              * U G L Y   K L U D G E
  578. -              * This utter piece of tripe is the only way I know of
  579. -              * to get around the fact that ATT BROKE standard IO
  580. -              * in System 5.2. Basically, you can't open a file for
  581. -              * "r+" and then try and write to it. This hack works
  582. -              * on all "real" USG Unix systems, It will probably
  583. -              * break on some obscure look alike that doesnt use the
  584. -              * real ATT stdio.h
  585. -              * Don't blame me, blame ATT. stdio should have
  586. -              * already done the following line for us, but it didn't
  587. -              */
  588. -             actfp->_flag |= _IOWRT;
  589. - #endif /* USG */
  590.               putc(*p, actfp);
  591.               fflush(actfp);
  592.               if (*p != 'm')
  593. --- 419,424 ----
  594. ***************
  595. *** 453,458 ****
  596. --- 439,459 ----
  597.           fprintf(actfp, "%s 00000 00001 %c\n", argv[1],
  598.               (argc > 2 && strcmp(argv[2], "moderated") == 0) 
  599.                   ? 'm' : 'y');
  600. + #ifdef USG
  601. +         /*
  602. +          * U G L Y   K L U D G E
  603. +          * This utter piece of tripe is the only way I know of
  604. +          * to get around the fact that ATT BROKE standard IO
  605. +          * in System 5.2. Basically, you can't open a file for
  606. +          * "r+" and then try and write to it. This hack works
  607. +          * on all "real" USG Unix systems, It will probably
  608. +          * break on some obscure look alike that doesnt use the
  609. +          * real ATT stdio.h
  610. +          * Don't blame me, blame ATT. stdio should have
  611. +          * already done the following line for us, but it didn't
  612. +          */
  613. +         actfp->_flag |= _IOWRT;
  614. + #endif /* USG */
  615.           fflush(actfp);
  616.       }
  617.   
  618. ***************
  619. *** 612,618 ****
  620.           (void) strcpy(nfilename, dirname(p));
  621.           fp = fopen(nfilename, "r");
  622.           if (fp == NULL) {
  623. !             log("Already Cancelled %s", line);
  624.               return 1;
  625.           }
  626.           htmp.unrec[0] = NULL;
  627. --- 613,619 ----
  628.           (void) strcpy(nfilename, dirname(p));
  629.           fp = fopen(nfilename, "r");
  630.           if (fp == NULL) {
  631. !             log("Can't cancel %s: %s", line, errmsg(errno));
  632.               return 1;
  633.           }
  634.           htmp.unrec[0] = NULL;
  635. ***************
  636. *** 950,957 ****
  637.       register char *p;
  638.   
  639.       if (sendto[0] <= ' ') {
  640. !         log("nasty mail name %s from %s", sendto, header.path);
  641. !         xxit(1);
  642.       }
  643.       for (p=sendto; *p; p++) {
  644.           if (*p == ' ') {
  645. --- 951,957 ----
  646.       register char *p;
  647.   
  648.       if (sendto[0] <= ' ') {
  649. !         xerror("nasty mail name %s from %s", sendto, header.path);
  650.       }
  651.       for (p=sendto; *p; p++) {
  652.           if (*p == ' ') {
  653. ***************
  654. *** 1007,1018 ****
  655.           return;    /* no restrictions at this level */
  656.       } else if (strcmp(msg, "delsub") == 0) {
  657.           if (!prefix(header.nbuf, "to.")) {
  658. !             printf("Must be in a 'to.system' newsgroup.");
  659.               xxit(0);
  660.           }
  661.           return;
  662.       } else {
  663. !         printf("Unrecognized control message - %s\n", msg);
  664.           xxit(0);
  665.       }
  666.   }
  667. --- 1007,1018 ----
  668.           return;    /* no restrictions at this level */
  669.       } else if (strcmp(msg, "delsub") == 0) {
  670.           if (!prefix(header.nbuf, "to.")) {
  671. !             log("Must be in a 'to.system' newsgroup.");
  672.               xxit(0);
  673.           }
  674.           return;
  675.       } else {
  676. !         log("Unrecognized control message - %s\n", msg);
  677.           xxit(0);
  678.       }
  679.   }
  680.  
  681. Index: expire.c
  682. Prereq: 2.47
  683. *** .d/expire.c    Thu Oct 30 16:09:39 1986
  684. --- expire.c    Fri Nov 21 14:05:03 1986
  685. ***************
  686. *** 17,23 ****
  687.    */
  688.   
  689.   #ifdef SCCSID
  690. ! static char    *SccsId = "@(#)expire.c    2.47    10/23/86";
  691.   #endif /* SCCSID */
  692.   
  693.   #include "params.h"
  694. --- 17,23 ----
  695.    */
  696.   
  697.   #ifdef SCCSID
  698. ! static char    *SccsId = "@(#)expire.c    2.48    11/21/86";
  699.   #endif /* SCCSID */
  700.   
  701.   #include "params.h"
  702. ***************
  703. *** 27,37 ****
  704.   # include <sys/file.h>
  705.   #else
  706.   # include "ndir.h"
  707. - # ifdef LOCKF
  708. - # include <unistd.h>
  709. - # endif /* LOCKF */
  710.   #endif
  711.   
  712.   char *Progname = "expire";    /* used by xerror to identify failing program */
  713.   
  714.   /*    Number of array entries to allocate at a time.    */
  715. --- 27,38 ----
  716.   # include <sys/file.h>
  717.   #else
  718.   # include "ndir.h"
  719.   #endif
  720.   
  721. + #ifdef LOCKF
  722. + #include <unistd.h>
  723. + #endif /* LOCKF */
  724.   char *Progname = "expire";    /* used by xerror to identify failing program */
  725.   
  726.   /*    Number of array entries to allocate at a time.    */
  727. ***************
  728. *** 1025,1031 ****
  729.       register char *p;
  730.       long fpos;
  731.   
  732. -     (void) umask(0);
  733.       (void) sprintf(namebuf, "%s.dir", ARTFILE);
  734.       (void) close(creat(namebuf, 0666));
  735.       (void) sprintf(namebuf, "%s.pag", ARTFILE);
  736. --- 1026,1031 ----
  737. Index: rextern.c
  738. Prereq: 2.15
  739. *** .d/rextern.c    Thu Oct 30 16:11:21 1986
  740. --- rextern.c    Fri Nov 21 14:05:20 1986
  741. ***************
  742. *** 3,9 ****
  743.    */
  744.   
  745.   #ifdef SCCSID
  746. ! static char    *SccsId = "@(#)rextern.c    2.15    4/16/85";
  747.   #endif /* SCCSID */
  748.   
  749.   /*LINTLIBRARY*/
  750. --- 3,9 ----
  751.    */
  752.   
  753.   #ifdef SCCSID
  754. ! static char    *SccsId = "@(#)rextern.c    2.17    11/21/86";
  755.   #endif /* SCCSID */
  756.   
  757.   /*LINTLIBRARY*/
  758. ***************
  759. *** 26,32 ****
  760.   char    *infile = "/tmp/M2XXXXXX";    /* -T output from Mail        */
  761.   int    ngrp, line = -1;
  762.   
  763. ! char    filename[BUFLEN], coptbuf[BUFLEN], datebuf[BUFLEN];
  764.   char    afline[BUFLEN];
  765.   FILE    *rcfp, *actfp;
  766.   time_t    atime;
  767. --- 26,32 ----
  768.   char    *infile = "/tmp/M2XXXXXX";    /* -T output from Mail        */
  769.   int    ngrp, line = -1;
  770.   
  771. ! char    filename[BUFLEN];
  772.   char    afline[BUFLEN];
  773.   FILE    *rcfp, *actfp;
  774.   time_t    atime;
  775.  
  776. Index: uname.c
  777. Prereq: 2.11
  778. *** .d/uname.c    Thu Oct 30 16:11:56 1986
  779. --- uname.c    Fri Nov 21 14:05:20 1986
  780. ***************
  781. *** 21,27 ****
  782.    */
  783.   
  784.   #ifdef SCCSID
  785. ! static char    *SccsId = "@(#)uname.c    2.11    10/23/86";
  786.   #endif /* SCCSID */
  787.   
  788.   #include "params.h"
  789. --- 21,27 ----
  790.    */
  791.   
  792.   #ifdef SCCSID
  793. ! static char    *SccsId = "@(#)uname.c    2.12    11/21/86";
  794.   #endif /* SCCSID */
  795.   
  796.   #include "params.h"
  797. ***************
  798. *** 36,41 ****
  799. --- 36,43 ----
  800.   {
  801.       char *cp;
  802.       gethostname(uptr->nodename, sizeof (uptr->nodename));
  803. +     if (MYDOMAIN[0] == '\0') /* get domain name from hostname */
  804. +         return;
  805.       cp = index(uptr->nodename, '.');
  806.       if (cp)
  807.           *cp = '\0';
  808. Index: unbatch.c
  809. Prereq: 1.22
  810. *** .d/unbatch.c    Thu Oct 30 16:09:28 1986
  811. --- unbatch.c    Fri Nov 21 14:05:21 1986
  812. ***************
  813. *** 13,22 ****
  814.    */
  815.   
  816.   #ifdef SCCSID
  817. ! static char    *SccsId = "@(#)unbatch.c    1.22    10/23/86";
  818.   #endif /* SCCSID */
  819.   
  820. ! #define    MAXARGS        20
  821.   
  822.   #include "defs.h"
  823.   #include <stdio.h>
  824. --- 13,22 ----
  825.    */
  826.   
  827.   #ifdef SCCSID
  828. ! static char    *SccsId = "@(#)unbatch.c    1.23    11/21/86";
  829.   #endif /* SCCSID */
  830.   
  831. ! #define    MAXARGS        32
  832.   
  833.   #include "defs.h"
  834.   #include <stdio.h>
  835. ***************
  836. *** 179,184 ****
  837. --- 179,185 ----
  838.   /* VARARGS1 */
  839.   logerr(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
  840.   char *fmt;
  841. + long a1, a2, a3, a4, a5, a6, a7, a8, a9;
  842.   {
  843.       FILE *logfile;
  844.       char lfname[BUFSIZ];        /* the log file */
  845.  
  846. Index: uurec.c
  847. Prereq: 2.9
  848. *** .d/uurec.c    Thu Oct 30 16:16:56 1986
  849. --- uurec.c    Fri Nov 21 14:05:22 1986
  850. ***************
  851. *** 3,9 ****
  852.    */
  853.   
  854.   #ifdef SCCSID
  855. ! static char    *SccsId = "@(#)uurec.c    2.9    4/16/85";
  856.   #endif /* SCCSID */
  857.   
  858.   #include "defs.h"
  859. --- 3,9 ----
  860.    */
  861.   
  862.   #ifdef SCCSID
  863. ! static char    *SccsId = "@(#)uurec.c    2.10    11/21/86";
  864.   #endif /* SCCSID */
  865.   
  866.   #include "defs.h"
  867. ***************
  868. *** 126,132 ****
  869.               mode = SKIPPING;
  870.           }
  871.       }
  872. !     if (pipe)
  873.           pclose(pipe);
  874.       exit(0);
  875.   }
  876. --- 126,132 ----
  877.               mode = SKIPPING;
  878.           }
  879.       }
  880. !     if (pipe && pipe != stdout)
  881.           pclose(pipe);
  882.       exit(0);
  883.   }
  884.  
  885. Index: funcs.c
  886. Prereq: 2.33
  887. *** .d/funcs.c    Thu Oct 30 16:11:13 1986
  888. --- funcs.c    Fri Nov 21 14:05:04 1986
  889. ***************
  890. *** 16,22 ****
  891.    */
  892.   
  893.   #ifdef SCCSID
  894. ! static char    *SccsId = "@(#)funcs.c    2.33    10/23/86";
  895.   #endif /* SCCSID */
  896.   
  897.   /*LINTLIBRARY*/
  898. --- 16,22 ----
  899.    */
  900.   
  901.   #ifdef SCCSID
  902. ! static char    *SccsId = "@(#)funcs.c    2.34    11/21/86";
  903.   #endif /* SCCSID */
  904.   
  905.   /*LINTLIBRARY*/
  906. ***************
  907. *** 321,327 ****
  908.   char *lfsuffix[] = {
  909.       "log",
  910.       "errlog",
  911. !     0
  912.   };
  913.   
  914.   /*
  915. --- 321,327 ----
  916.   char *lfsuffix[] = {
  917.       "log",
  918.       "errlog",
  919. !     NULL,
  920.   };
  921.   
  922.   /*
  923. ***************
  924. *** 471,477 ****
  925. --- 471,497 ----
  926.   int perm;
  927.   {
  928.       int pid, status;
  929. + #ifdef USG
  930. +     char parent[200];
  931. +     char *p;
  932. +     struct stat sbuf;
  933.   
  934. +     /*
  935. +      * Make parent directory writable, because we will
  936. +      * be creating a directory owned by the real user,
  937. +      * rather than by news.
  938. +      */
  939. +     (void) strcpy(parent, path);
  940. +     if (p = rindex(parent, '/')) {
  941. +         *p = '\0';
  942. +         if (stat(parent, &sbuf) == 0)
  943. +             (void) chmod(parent, 0777);
  944. +         else
  945. +             return -1;
  946. +     } else
  947. +         return -1;
  948. + #endif
  949.       if (pid=vfork()) {
  950.           status = fwait(pid);
  951.   #if defined(USG) && !defined(CHEAP)
  952. ***************
  953. *** 495,500 ****
  954. --- 515,523 ----
  955.           perror(path);
  956.           _exit(1);
  957.       }
  958. + #ifdef USG
  959. +     (void) chmod(parent, sbuf.st_mode); /* Restore mode of parent */
  960. + #endif
  961.       return status;
  962.   }
  963.   #endif /* !BSD4_2 && ! BSD4_1C */
  964.  
  965. Index: getdate.y
  966. Prereq: 2.13
  967. *** .d/getdate.y    Thu Oct 30 16:11:06 1986
  968. --- getdate.y    Fri Nov 21 14:05:05 1986
  969. ***************
  970. *** 1,9 ****
  971.   %token ID MONTH DAY MERIDIAN NUMBER UNIT MUNIT SUNIT ZONE DAYZONE AGO
  972.   %{
  973. !     /*     Steven M. Bellovin (unc!smb)            */
  974.       /*    Dept. of Computer Science            */
  975.       /*    University of North Carolina at Chapel Hill    */
  976. !     /*    @(#)getdate.y    2.13    9/16/86 */
  977.   
  978.   #include <sys/types.h>
  979.   #ifdef USG
  980. --- 1,9 ----
  981.   %token ID MONTH DAY MERIDIAN NUMBER UNIT MUNIT SUNIT ZONE DAYZONE AGO
  982.   %{
  983. !     /*     Originally from: Steven M. Bellovin (unc!smb)    */ 
  984.       /*    Dept. of Computer Science            */
  985.       /*    University of North Carolina at Chapel Hill    */
  986. !     /*    @(#)getdate.y    2.14    11/21/86    */
  987.   
  988.   #include <sys/types.h>
  989.   #ifdef USG
  990. ***************
  991. *** 69,75 ****
  992.           {hh = $1; mm = $3; merid = $4;}
  993.       | NUMBER ':' NUMBER NUMBER =
  994.           {hh = $1; mm = $3; merid = 24;
  995. !         daylight = STANDARD; ourzone = $4%100 + 60*$4/100;}
  996.       | NUMBER ':' NUMBER ':' NUMBER =
  997.           {hh = $1; mm = $3; ss = $5; merid = 24;}
  998.       | NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
  999. --- 69,75 ----
  1000.           {hh = $1; mm = $3; merid = $4;}
  1001.       | NUMBER ':' NUMBER NUMBER =
  1002.           {hh = $1; mm = $3; merid = 24;
  1003. !         daylight = STANDARD; ourzone = -($4%100 + 60*($4/100));}
  1004.       | NUMBER ':' NUMBER ':' NUMBER =
  1005.           {hh = $1; mm = $3; ss = $5; merid = 24;}
  1006.       | NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
  1007. ***************
  1008. *** 76,82 ****
  1009.           {hh = $1; mm = $3; ss = $5; merid = $6;}
  1010.       | NUMBER ':' NUMBER ':' NUMBER NUMBER =
  1011.           {hh = $1; mm = $3; ss = $5; merid = 24;
  1012. !         daylight = STANDARD; ourzone = $6%100 + 60*$6/100;};
  1013.   
  1014.   zone:    ZONE =
  1015.           {ourzone = $1; daylight = STANDARD;}
  1016. --- 76,82 ----
  1017.           {hh = $1; mm = $3; ss = $5; merid = $6;}
  1018.       | NUMBER ':' NUMBER ':' NUMBER NUMBER =
  1019.           {hh = $1; mm = $3; ss = $5; merid = 24;
  1020. !         daylight = STANDARD; ourzone = -($6%100 + 60*($6/100));};
  1021.   
  1022.   zone:    ZONE =
  1023.           {ourzone = $1; daylight = STANDARD;}
  1024. ***************
  1025. *** 125,131 ****
  1026.   #define epoch 1970
  1027.   
  1028.   extern struct tm *localtime();
  1029. ! time_t dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
  1030.   int mm, dd, yy, h, m, s, mer, zone, dayflag;
  1031.   {
  1032.       time_t tod, jdate;
  1033. --- 125,133 ----
  1034.   #define epoch 1970
  1035.   
  1036.   extern struct tm *localtime();
  1037. ! time_t
  1038. ! dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
  1039.   int mm, dd, yy, h, m, s, mer, zone, dayflag;
  1040.   {
  1041.       time_t tod, jdate;
  1042. ***************
  1043. *** 149,155 ****
  1044.       return (jdate);
  1045.   }
  1046.   
  1047. ! time_t dayconv(ord, day, now) int ord, day; time_t now;
  1048.   {
  1049.       register struct tm *loctime;
  1050.       time_t tod;
  1051. --- 151,159 ----
  1052.       return (jdate);
  1053.   }
  1054.   
  1055. ! time_t
  1056. ! dayconv(ord, day, now)
  1057. ! int ord, day; time_t now;
  1058.   {
  1059.       register struct tm *loctime;
  1060.       time_t tod;
  1061. ***************
  1062. *** 162,168 ****
  1063.       return daylcorr(tod, now);
  1064.   }
  1065.   
  1066. ! time_t timeconv(hh, mm, ss, mer) register int hh, mm, ss, mer;
  1067.   {
  1068.       if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
  1069.       switch (mer) {
  1070. --- 166,174 ----
  1071.       return daylcorr(tod, now);
  1072.   }
  1073.   
  1074. ! time_t
  1075. ! timeconv(hh, mm, ss, mer)
  1076. ! register int hh, mm, ss, mer;
  1077.   {
  1078.       if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
  1079.       switch (mer) {
  1080. ***************
  1081. *** 175,181 ****
  1082.           default: return (-1);
  1083.       }
  1084.   }
  1085. ! time_t monthadd(sdate, relmonth) time_t sdate, relmonth;
  1086.   {
  1087.       struct tm *ltime;
  1088.       time_t dateconv();
  1089. --- 181,189 ----
  1090.           default: return (-1);
  1091.       }
  1092.   }
  1093. ! time_t
  1094. ! monthadd(sdate, relmonth)
  1095. ! time_t sdate, relmonth;
  1096.   {
  1097.       struct tm *ltime;
  1098.       time_t dateconv();
  1099. ***************
  1100. *** 191,197 ****
  1101.           ltime->tm_min, ltime->tm_sec, 24, ourzone, MAYBE), sdate);
  1102.   }
  1103.   
  1104. ! time_t daylcorr(future, now) time_t future, now;
  1105.   {
  1106.       int fdayl, nowdayl;
  1107.   
  1108. --- 199,207 ----
  1109.           ltime->tm_min, ltime->tm_sec, 24, ourzone, MAYBE), sdate);
  1110.   }
  1111.   
  1112. ! time_t
  1113. ! daylcorr(future, now)
  1114. ! time_t future, now;
  1115.   {
  1116.       int fdayl, nowdayl;
  1117.   
  1118. ***************
  1119. *** 212,218 ****
  1120.       int pcnt;
  1121.   
  1122.       for (;;) {
  1123. !         while (isspace(*lptr)) lptr++;
  1124.   
  1125.           if (isdigit(c = *lptr) || c == '-' || c == '+') {
  1126.               if (c== '-' || c == '+') {
  1127. --- 222,229 ----
  1128.       int pcnt;
  1129.   
  1130.       for (;;) {
  1131. !         while (isspace(*lptr))
  1132. !             lptr++;
  1133.   
  1134.           if (isdigit(c = *lptr) || c == '-' || c == '+') {
  1135.               if (c== '-' || c == '+') {
  1136. ***************
  1137. *** 224,230 ****
  1138.                   }
  1139.               } else sign = 1;
  1140.               yylval = 0;
  1141. !             while (isdigit(c = *lptr++)) yylval = 10*yylval + c - '0';
  1142.               yylval *= sign;
  1143.               lptr--;
  1144.               return (NUMBER);
  1145. --- 235,242 ----
  1146.                   }
  1147.               } else sign = 1;
  1148.               yylval = 0;
  1149. !             while (isdigit(c = *lptr++))
  1150. !                 yylval = 10*yylval + c - '0';
  1151.               yylval *= sign;
  1152.               lptr--;
  1153.               return (NUMBER);
  1154. ***************
  1155. *** 258,288 ****
  1156.   };
  1157.   
  1158.   struct table mdtab[] = {
  1159. !     {"January", MONTH, 1},
  1160. !     {"February", MONTH, 2},
  1161. !     {"March", MONTH, 3},
  1162. !     {"April", MONTH, 4},
  1163. !     {"May", MONTH, 5},
  1164. !     {"June", MONTH, 6},
  1165. !     {"July", MONTH, 7},
  1166. !     {"August", MONTH, 8},
  1167. !     {"September", MONTH, 9},
  1168. !     {"Sept", MONTH, 9},
  1169. !     {"October", MONTH, 10},
  1170. !     {"November", MONTH, 11},
  1171. !     {"December", MONTH, 12},
  1172.   
  1173. !     {"Sunday", DAY, 0},
  1174. !     {"Monday", DAY, 1},
  1175. !     {"Tuesday", DAY, 2},
  1176. !     {"Tues", DAY, 2},
  1177. !     {"Wednesday", DAY, 3},
  1178. !     {"Wednes", DAY, 3},
  1179. !     {"Thursday", DAY, 4},
  1180. !     {"Thur", DAY, 4},
  1181. !     {"Thurs", DAY, 4},
  1182. !     {"Friday", DAY, 5},
  1183. !     {"Saturday", DAY, 6},
  1184.       {0, 0, 0}};
  1185.   
  1186.   #define HRS *60
  1187. --- 270,300 ----
  1188.   };
  1189.   
  1190.   struct table mdtab[] = {
  1191. !     {"january", MONTH, 1},
  1192. !     {"february", MONTH, 2},
  1193. !     {"march", MONTH, 3},
  1194. !     {"april", MONTH, 4},
  1195. !     {"may", MONTH, 5},
  1196. !     {"june", MONTH, 6},
  1197. !     {"july", MONTH, 7},
  1198. !     {"august", MONTH, 8},
  1199. !     {"september", MONTH, 9},
  1200. !     {"sept", MONTH, 9},
  1201. !     {"october", MONTH, 10},
  1202. !     {"november", MONTH, 11},
  1203. !     {"december", MONTH, 12},
  1204.   
  1205. !     {"sunday", DAY, 0},
  1206. !     {"monday", DAY, 1},
  1207. !     {"tuesday", DAY, 2},
  1208. !     {"tues", DAY, 2},
  1209. !     {"wednesday", DAY, 3},
  1210. !     {"wednes", DAY, 3},
  1211. !     {"thursday", DAY, 4},
  1212. !     {"thur", DAY, 4},
  1213. !     {"thurs", DAY, 4},
  1214. !     {"friday", DAY, 5},
  1215. !     {"saturday", DAY, 6},
  1216.       {0, 0, 0}};
  1217.   
  1218.   #define HRS *60
  1219. ***************
  1220. *** 420,486 ****
  1221.       {"z", ZONE, 0 HRS},
  1222.       {0, 0, 0}};
  1223.   
  1224. ! lookup(id) char *id;
  1225.   {
  1226.   #define gotit (yylval=i->value,  i->type)
  1227. - #define getid for(j=idvar, k=id; *j++ = *k++; )
  1228.   
  1229. !     char idvar[20];
  1230.       register char *j, *k;
  1231.       register struct table *i;
  1232.       int abbrev;
  1233.   
  1234. !     getid;
  1235. !     if (strlen(idvar) == 3) abbrev = 1;
  1236. !     else if (strlen(idvar) == 4 && idvar[3] == '.') {
  1237.           abbrev = 1;
  1238. !         idvar[3] = '\0';
  1239. !     }
  1240. !     else abbrev = 0;
  1241.   
  1242. -     if (islower(*idvar)) *idvar = toupper(*idvar);
  1243.       for (i = mdtab; i->name; i++) {
  1244.           k = idvar;
  1245.           for (j = i->name; *j++ == *k++;) {
  1246. !             if (abbrev && j==i->name+3) return gotit;
  1247. !             if (j[-1] == 0) return gotit;
  1248.           }
  1249.       }
  1250.   
  1251. -     getid;
  1252.       for (i = mztab; i->name; i++)
  1253. !         if (strcmp(i->name, idvar) == 0) return gotit;
  1254.   
  1255. -     for (j = idvar; *j; j++)
  1256. -         if (isupper(*j)) *j = tolower(*j);
  1257.       for (i=mztab; i->name; i++)
  1258. !         if (strcmp(i->name, idvar) == 0) return gotit;
  1259.   
  1260. -     getid;
  1261.       for (i=unittb; i->name; i++)
  1262. !         if (strcmp(i->name, idvar) == 0) return gotit;
  1263.   
  1264.       if (idvar[strlen(idvar)-1] == 's')
  1265.           idvar[strlen(idvar)-1] = '\0';
  1266.       for (i=unittb; i->name; i++)
  1267. !         if (strcmp(i->name, idvar) == 0) return gotit;
  1268.   
  1269. -     getid;
  1270.       for (i = othertb; i->name; i++)
  1271. !         if (strcmp(i->name, idvar) == 0) return gotit;
  1272.   
  1273. -     getid;
  1274.       if (strlen(idvar) == 1 && isalpha(*idvar)) {
  1275. -         if (isupper(*idvar)) *idvar = tolower(*idvar);
  1276.           for (i = milzone; i->name; i++)
  1277. !             if (strcmp(i->name, idvar) == 0) return gotit;
  1278.       }
  1279.   
  1280. !     return(ID);
  1281.   }
  1282.   
  1283. ! time_t getdate(p, now) char *p; struct timeb *now;
  1284.   {
  1285.   #define mcheck(f)    if (f>1) err++
  1286.       time_t monthadd();
  1287. --- 432,510 ----
  1288.       {"z", ZONE, 0 HRS},
  1289.       {0, 0, 0}};
  1290.   
  1291. ! lookup(id)
  1292. ! char *id;
  1293.   {
  1294.   #define gotit (yylval=i->value,  i->type)
  1295.   
  1296. !     char idvar[128];
  1297.       register char *j, *k;
  1298.       register struct table *i;
  1299.       int abbrev;
  1300.   
  1301. !     (void) strcpy(idvar, id);
  1302. !     j = idvar;
  1303. !     k = id - 1;
  1304. !     while (*++k)
  1305. !         *j++ = isupper(*k) ? tolower(*k) : *k;
  1306. !     *j = '\0';
  1307. !     if (strlen(idvar) == 3)
  1308.           abbrev = 1;
  1309. !     else
  1310. !         if (strlen(idvar) == 4 && idvar[3] == '.') {
  1311. !             abbrev = 1;
  1312. !             idvar[3] = '\0';
  1313. !         }
  1314. !     else
  1315. !         abbrev = 0;
  1316.   
  1317.       for (i = mdtab; i->name; i++) {
  1318.           k = idvar;
  1319.           for (j = i->name; *j++ == *k++;) {
  1320. !             if (abbrev && j == i->name+3)
  1321. !                 return gotit;
  1322. !             if (j[-1] == 0)
  1323. !                 return gotit;
  1324.           }
  1325.       }
  1326.   
  1327.       for (i = mztab; i->name; i++)
  1328. !         if (strcmp(i->name, idvar) == 0)
  1329. !             return gotit;
  1330.   
  1331.       for (i=mztab; i->name; i++)
  1332. !         if (strcmp(i->name, idvar) == 0)
  1333. !             return gotit;
  1334.   
  1335.       for (i=unittb; i->name; i++)
  1336. !         if (strcmp(i->name, idvar) == 0)
  1337. !             return gotit;
  1338.   
  1339.       if (idvar[strlen(idvar)-1] == 's')
  1340.           idvar[strlen(idvar)-1] = '\0';
  1341.       for (i=unittb; i->name; i++)
  1342. !         if (strcmp(i->name, idvar) == 0)
  1343. !             return gotit;
  1344.   
  1345.       for (i = othertb; i->name; i++)
  1346. !         if (strcmp(i->name, idvar) == 0)
  1347. !             return gotit;
  1348.   
  1349.       if (strlen(idvar) == 1 && isalpha(*idvar)) {
  1350.           for (i = milzone; i->name; i++)
  1351. !             if (strcmp(i->name, idvar) == 0)
  1352. !                 return gotit;
  1353.       }
  1354.   
  1355. !     return ID;
  1356.   }
  1357.   
  1358. ! time_t
  1359. ! getdate(p, now)
  1360. ! char *p;
  1361. ! struct timeb *now;
  1362.   {
  1363.   #define mcheck(f)    if (f>1) err++
  1364.       time_t monthadd();
  1365.  
  1366. Index: postnews.c
  1367. Prereq: 1.28
  1368. *** .d/postnews.c    Thu Oct 30 16:09:17 1986
  1369. --- postnews.c    Fri Nov 21 14:05:17 1986
  1370. ***************
  1371. *** 18,24 ****
  1372.    */
  1373.   
  1374.   #ifdef SCCSID
  1375. ! static char    *SccsId = "@(#)postnews.c    1.28    10/23/86";
  1376.   #endif /* SCCSID */
  1377.   
  1378.   #include "params.h"
  1379. --- 18,24 ----
  1380.    */
  1381.   
  1382.   #ifdef SCCSID
  1383. ! static char    *SccsId = "@(#)postnews.c    1.29    11/21/86";
  1384.   #endif /* SCCSID */
  1385.   
  1386.   #include "params.h"
  1387. ***************
  1388. *** 308,314 ****
  1389.       }
  1390.       if (deflt != (char *)0)
  1391.           (void) strcpy(def, deflt);
  1392. !     if (ngmatch("net.test", newsgroups))
  1393.           (void) strcpy(def, "local");
  1394.       for(;;) {
  1395.           do {
  1396. --- 308,314 ----
  1397.       }
  1398.       if (deflt != (char *)0)
  1399.           (void) strcpy(def, deflt);
  1400. !     if (ngmatch("misc.test", newsgroups))
  1401.           (void) strcpy(def, "local");
  1402.       for(;;) {
  1403.           do {
  1404. ***************
  1405. *** 333,354 ****
  1406.           /* Check that it's a proper distribution */
  1407.           for (i=0; distr[i].abbr[0]; i++) {
  1408.               if (strncmp(distr[i].abbr, distribution, sizeof(distr[0].abbr)) == 0) {
  1409. -                 register int n;
  1410. -                 /* Found a match. Do any special rewriting. */
  1411. -                 r = newsgroups;
  1412. -                 n = strlen(distribution);
  1413. -                 /*
  1414. -                  * A distribution of foo is useless
  1415. -                  * if all the newsgroups are in foo.all
  1416. -                  */
  1417. -                 for (;;) {
  1418. -                     if (strncmp(r, distribution, n))
  1419. -                         return;
  1420. -                     if ((r = index(r, NGDELIM)) == NULL)
  1421. -                         break;
  1422. -                     ++r;
  1423. -                 }
  1424. -                 distribution[0] = '\0';
  1425.                   return;
  1426.               }
  1427.           }
  1428. --- 333,338 ----
  1429. ***************
  1430. *** 515,520 ****
  1431. --- 499,506 ----
  1432.       if (!article_line(tempfname, "Newsgroups: ", group)) {
  1433.     nogroups:
  1434.           printf("Not sending to any newsgroups - no message posted\n");
  1435. +         sprintf(ccname, "%s/dead.article", homedir);
  1436. +         save_article();
  1437.           (void) UNLINK(tempfname);
  1438.           exit(1);
  1439.       }
  1440. ***************
  1441. *** 529,535 ****
  1442.       *p = '\0';
  1443.   
  1444.       /* Sanity checks for certain newsgroups */
  1445. !     if (ngmatch(newsgroups, "all.wanted") && ngmatch(distribution,"net,na,usa,att,btl,eunet,aus")) {
  1446.           printf("Is your message something that might go in your local\n");
  1447.           printf("newspaper, for example a used car ad, or an apartment\n");
  1448.           printf("for rent? ");
  1449. --- 515,521 ----
  1450.       *p = '\0';
  1451.   
  1452.       /* Sanity checks for certain newsgroups */
  1453. !     if (ngmatch(newsgroups, "all.wanted") && ngmatch(distribution,"world,na,usa,att,btl,eunet,aus")) {
  1454.           printf("Is your message something that might go in your local\n");
  1455.           printf("newspaper, for example a used car ad, or an apartment\n");
  1456.           printf("for rent? ");
  1457. ***************
  1458. *** 542,548 ****
  1459.           }
  1460.       }
  1461.   
  1462. !     if (ngmatch(newsgroups, "all.jokes")) {
  1463.           if (askyes("Could this be offensive to anyone? ","")) {
  1464.               getpr("Whom might it offend? ", group);
  1465.               (void) sprintf(buf," - offensive to %s (rot 13)",group);
  1466. --- 528,534 ----
  1467.           }
  1468.       }
  1469.   
  1470. !     if (ngmatch(newsgroups, "rec.humor,!rec.humor.d")) {
  1471.           if (askyes("Could this be offensive to anyone? ","")) {
  1472.               getpr("Whom might it offend? ", group);
  1473.               (void) sprintf(buf," - offensive to %s (rot 13)",group);
  1474. ***************
  1475. *** 551,581 ****
  1476.           }
  1477.       }
  1478.   
  1479. !     if (ngmatch(newsgroups, "net.general")) {
  1480. !         if (index(newsgroups, NGDELIM)) {
  1481. !             printf("Everybody in the world reads net.general, so it doesn't make\n");
  1482. !             printf("sense to post to newsgroups in addition to net.general.  If your\n");
  1483. !             printf("article belongs in one of these other newsgroups, then you\n");
  1484. !             printf("should not post to net.general.    If it is important enough\n");
  1485. !             printf("for net.general, then you shouldn't post it in other places\n");
  1486. !             printf("as well.    Please reenter the newsgroups.\n");
  1487. !             while (!get_newsgroup())
  1488. !                 ;
  1489. !             modify_article(tempfname, "Newsgroups: ", newsgroups,REPLACE);
  1490. !         }
  1491. !         if (ngmatch(newsgroups, "net.general")) {
  1492. !             printf("net.general is for important announcements.\n");
  1493. !             printf("It is not for items for which you couldn't think\n");
  1494. !             printf("of a better place - those belong in net.misc.\n");
  1495. !             if (!askyes("Are you sure your message belongs in net.general? ","")) {
  1496. !                 while (!get_newsgroup())
  1497. !                     ;
  1498. !                 modify_article(tempfname, "Newsgroups: ", newsgroups, REPLACE);
  1499. !             }
  1500. !         }
  1501. !     }
  1502. !     if (ngmatch(newsgroups, "net.sources,!net.sources.all")) {
  1503.           if (!article_line(tempfname, "Subject: ", group)) {
  1504.     nosubj:
  1505.               printf("There seems to be no subject for this article.\n");
  1506. --- 537,543 ----
  1507.           }
  1508.       }
  1509.   
  1510. !     if (ngmatch(newsgroups, "comp.sources.all,!comp.sources.wanted")) {
  1511.           if (!article_line(tempfname, "Subject: ", group)) {
  1512.     nosubj:
  1513.               printf("There seems to be no subject for this article.\n");
  1514. ***************
  1515. *** 591,604 ****
  1516.           }
  1517.           if (ngmatch(newsgroups, "all.wanted") || iswanted(subject)) {
  1518.               printf("Requests for sources should not be posted to any of\n");
  1519. !             printf("the net.sources newsgroups, please post such requests\n");
  1520. !             printf("to net.wanted.sources only.     Please reenter the newsgroups.\n\n");
  1521.               while (!get_newsgroup())
  1522.                   ;
  1523.               modify_article(tempfname, "Newsgroups: ", newsgroups, REPLACE);
  1524.           }
  1525. !         if (ngmatch(newsgroups, "net.sources")) {
  1526. !             if (!ngmatch(newsgroups, "net.sources.all") &&
  1527.                   stbuf.st_size < (4*1024)) {
  1528.                   printf("Your article seems rather small to be a source distribution.\n");
  1529.                   if (!askyes("Are you certain that this is really source? ", "")) {
  1530. --- 553,566 ----
  1531.           }
  1532.           if (ngmatch(newsgroups, "all.wanted") || iswanted(subject)) {
  1533.               printf("Requests for sources should not be posted to any of\n");
  1534. !             printf("the comp.sources newsgroups, please post such requests\n");
  1535. !             printf("to comp.sources.wanted only.     Please reenter the newsgroups.\n\n");
  1536.               while (!get_newsgroup())
  1537.                   ;
  1538.               modify_article(tempfname, "Newsgroups: ", newsgroups, REPLACE);
  1539.           }
  1540. !         if (ngmatch(newsgroups, "comp.sources.all")) {
  1541. !             if (!ngmatch(newsgroups, "comp.sources.wanted") &&
  1542.                   stbuf.st_size < (4*1024)) {
  1543.                   printf("Your article seems rather small to be a source distribution.\n");
  1544.                   if (!askyes("Are you certain that this is really source? ", "")) {
  1545. ***************
  1546. *** 989,1002 ****
  1547.       /* newsgroup */
  1548.       if (article_line(baseart, "Newsgroups: ", buf))
  1549.           (void) strcpy(newsgroups, buf+12);
  1550. !     if (ngmatch(newsgroups, "net.general"))
  1551. !         (void) strcpy(newsgroups,"net.followup");
  1552. !     if (ngmatch(newsgroups, "net.sources,!net.sources.all"))
  1553. !         (void) strcpy(newsgroups,"net.sources.d");
  1554. !     if (ngmatch(newsgroups, "net.jobs")) {
  1555. !         printf("net.jobs is for the direct posting of job announcements and requests.\n");
  1556. !         printf("it is not for discussion. You followup has been directed to net.misc\n");
  1557. !         (void) strcpy(newsgroups,"net.misc");
  1558.       }
  1559.   
  1560.       /* distribution */
  1561. --- 951,960 ----
  1562.       /* newsgroup */
  1563.       if (article_line(baseart, "Newsgroups: ", buf))
  1564.           (void) strcpy(newsgroups, buf+12);
  1565. !     if (ngmatch(newsgroups, "misc.jobs")) {
  1566. !         printf("misc.jobs is for the direct posting of job announcements and requests.\n");
  1567. !         printf("it is not for discussion. You followup has been directed to misc.misc\n");
  1568. !         (void) strcpy(newsgroups,"misc.misc");
  1569.       }
  1570.   
  1571.       /* distribution */
  1572. Index: defs.dist
  1573. Prereq: 2.55
  1574. *** .d/defs.dist    Thu Oct 30 16:17:04 1986
  1575. --- defs.dist    Fri Nov 21 14:36:10 1986
  1576. ***************
  1577. *** 14,20 ****
  1578.    *
  1579.    */
  1580.   
  1581. ! /*    @(#)defs.dist    2.55    10/30/86    */
  1582.   
  1583.   /*
  1584.    * defs.h - defines for news-related programs.
  1585. --- 14,20 ----
  1586.    *
  1587.    */
  1588.   
  1589. ! /*    @(#)defs.dist    2.56    11/21/86    */
  1590.   
  1591.   /*
  1592.    * defs.h - defines for news-related programs.
  1593. ***************
  1594. *** 28,47 ****
  1595.    * to be news_version below.
  1596.    */
  1597.   
  1598. - #define NEWS_VERSION   "B 2.11 10/30/86"
  1599.   #define DAYS    (60L*60L*24L)
  1600.   #define WEEKS    (7*DAYS)
  1601.   /* Things that very well may require local configuration */
  1602.   #ifndef HOME
  1603. ! #define    ROOTID    10    /* uid of person allowed to cancel anything    */
  1604.   #endif
  1605. ! #define    N_UMASK 000    /* mask for umask call, 022 for secure system    */
  1606.   #define DFLTEXP    2*WEEKS    /* default no. of seconds to expire in        */
  1607.   #define HISTEXP    4*WEEKS    /* default no. of seconds to forget in        */
  1608.   #define DFLTSUB "general,all.announce"    /* default subscription list    */
  1609.   #define TMAIL    "/usr/ucb/Mail"    /* Mail program that understands -T    */
  1610. ! #define    ADMSUB    "general,all.announce"    /* Mandatory subscription list    */
  1611.   #define PAGE    "/usr/ucb/more"    /* Default pager            */
  1612.   #define NOTIFY    "usenet"    /* Tell him about certain ctl messages    */
  1613.                   /* Default xmit command - remove -z if    */
  1614. --- 28,45 ----
  1615.    * to be news_version below.
  1616.    */
  1617.   
  1618.   #define DAYS    (60L*60L*24L)
  1619.   #define WEEKS    (7*DAYS)
  1620.   /* Things that very well may require local configuration */
  1621.   #ifndef HOME
  1622. ! #define ROOTID    10    /* uid of person allowed to cancel anything    */
  1623.   #endif
  1624. ! #define N_UMASK 000    /* mask for umask call, 022 for secure system    */
  1625.   #define DFLTEXP    2*WEEKS    /* default no. of seconds to expire in        */
  1626.   #define HISTEXP    4*WEEKS    /* default no. of seconds to forget in        */
  1627.   #define DFLTSUB "general,all.announce"    /* default subscription list    */
  1628.   #define TMAIL    "/usr/ucb/Mail"    /* Mail program that understands -T    */
  1629. ! #define ADMSUB    "general,all.announce"    /* Mandatory subscription list    */
  1630.   #define PAGE    "/usr/ucb/more"    /* Default pager            */
  1631.   #define NOTIFY    "usenet"    /* Tell him about certain ctl messages    */
  1632.                   /* Default xmit command - remove -z if    */
  1633. ***************
  1634. *** 98,114 ****
  1635.   # define BUFLEN    256    /* standard buffer size                */
  1636.   #endif
  1637.   #define LBUFLEN 1024    /* big buffer size                */
  1638. ! #define    SBUFLEN 32    /* small buffer size (for system names, etc)    */
  1639.   #define LNCNT    14    /* Articles with > LNCNT lines go through pager */
  1640.   
  1641.   /* Things you probably won't want to change */
  1642.   #define PATHLEN 512    /* length of longest source string        */
  1643. ! #define    DATELEN    64    /* length of longest allowed date string    */
  1644. ! #define    NAMELEN    128    /* length of longest possible message ID    */
  1645. ! #define    SNLN    8    /* max significant characters in sysname    */
  1646. ! #define    PROTO    'A'    /* old protocol name                */
  1647.   #define NETCHRS    "!:@^%,"/* Punct. chars used for various networks    */
  1648. ! #define    TRUE    1    /* boolean true                    */
  1649. ! #define    FALSE    0    /* boolean false                */
  1650. ! #define    PERHAPS    2    /* indeterminate boolean value            */
  1651. ! #define    NGDELIM    ','    /* delimit character in news group line        */
  1652. --- 96,112 ----
  1653.   # define BUFLEN    256    /* standard buffer size                */
  1654.   #endif
  1655.   #define LBUFLEN 1024    /* big buffer size                */
  1656. ! #define SBUFLEN 32    /* small buffer size (for system names, etc)    */
  1657.   #define LNCNT    14    /* Articles with > LNCNT lines go through pager */
  1658.   
  1659.   /* Things you probably won't want to change */
  1660.   #define PATHLEN 512    /* length of longest source string        */
  1661. ! #define DATELEN    64    /* length of longest allowed date string    */
  1662. ! #define NAMELEN    128    /* length of longest possible message ID    */
  1663. ! #define SNLN    8    /* max significant characters in sysname    */
  1664. ! #define PROTO    'A'    /* old protocol name                */
  1665.   #define NETCHRS    "!:@^%,"/* Punct. chars used for various networks    */
  1666. ! #define TRUE    1    /* boolean true                    */
  1667. ! #define FALSE    0    /* boolean false                */
  1668. ! #define PERHAPS    2    /* indeterminate boolean value            */
  1669. ! #define NGDELIM    ','    /* delimit character in news group line        */
  1670.  
  1671. Index: Makefile.dst
  1672. Prereq: 1.17
  1673. *** .d/Makefile.dst    Thu Oct 30 16:16:32 1986
  1674. --- Makefile.dst    Fri Nov 21 14:04:57 1986
  1675. ***************
  1676. *** 1,4 ****
  1677. ! # '@(#)Makefile.dst    1.17    10/29/86'
  1678.   # Generic Makefile.
  1679.   # This is converted to USG/v7/etc by localize.sh
  1680.   # which should at least be a copy of localize.v7 or localize.usg
  1681. --- 1,4 ----
  1682. ! # '@(#)Makefile.dst    1.19    11/21/86'
  1683.   # Generic Makefile.
  1684.   # This is converted to USG/v7/etc by localize.sh
  1685.   # which should at least be a copy of localize.v7 or localize.usg
  1686. ***************
  1687. *** 98,104 ****
  1688.   COMMANDS = readnews checknews postnews vnews
  1689.   
  1690.   # dependencies
  1691. ! all: $(COMMANDS) $(OTHERS)
  1692.   
  1693.   install: all help vnews.help
  1694.       -mkdir $(DESTDIR)$(BINDIR)
  1695. --- 98,104 ----
  1696.   COMMANDS = readnews checknews postnews vnews
  1697.   
  1698.   # dependencies
  1699. ! all: $(OTHERS) $(COMMANDS)
  1700.   
  1701.   install: all help vnews.help
  1702.       -mkdir $(DESTDIR)$(BINDIR)
  1703. ***************
  1704. *** 300,306 ****
  1705.       $(CC) $(LFLAGS) -o expire $(EXPOBJS) $(LIBS)
  1706.   #VMS     mv expire.exe expire
  1707.   
  1708. ! header.o:  header.c header.h defs.h params.h Makefile
  1709.       $(CC) $(CFLAGS) -c header.c
  1710.   
  1711.   expire.o:  expire.c defs.h Makefile params.h ndir.h header.h Makefile
  1712. --- 300,306 ----
  1713.       $(CC) $(LFLAGS) -o expire $(EXPOBJS) $(LIBS)
  1714.   #VMS     mv expire.exe expire
  1715.   
  1716. ! header.o:  header.c header.h defs.h patchlevel.h params.h Makefile
  1717.       $(CC) $(CFLAGS) -c header.c
  1718.   
  1719.   expire.o:  expire.c defs.h Makefile params.h ndir.h header.h Makefile
  1720.  
  1721. Index: localize.v7
  1722. *** .d/localize.v7    Thu Oct 30 16:12:17 1986
  1723. --- localize.v7    Fri Nov 21 14:05:14 1986
  1724. ***************
  1725. *** 6,11 ****
  1726. --- 6,12 ----
  1727.   g/^#USG /d
  1728.   g/^#VMS /d
  1729.   g/^#BSD4_[123] /d
  1730. + g/#NOTVMS/s/#NOTVMS.*//
  1731.   w
  1732.   q
  1733.   EOF
  1734.  
  1735. Index: checkgroups.sh
  1736. Prereq: 1.17
  1737. *** .d/checkgroups.sh    Thu Oct 30 16:16:58 1986
  1738. --- checkgroups.sh    Fri Nov 21 14:04:58 1986
  1739. ***************
  1740. *** 1,5 ****
  1741.   : check active file for missing or extra newsgroups
  1742. ! : '@(#)checkgroups    1.17    10/29/86'
  1743.   
  1744.   if  test  ! -s LIBDIR/newsgroups
  1745.   then
  1746. --- 1,5 ----
  1747.   : check active file for missing or extra newsgroups
  1748. ! : '@(#)checkgroups    1.19    11/21/86'
  1749.   
  1750.   if  test  ! -s LIBDIR/newsgroups
  1751.   then
  1752. ***************
  1753. *** 22,50 ****
  1754.       group="^net\\.|^mod\\.|^comp\\.|^sci\\.|^rec\\.|^news\\.|^soc\\.|^misc\\.|^talk\\."
  1755.       egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
  1756.       cat /tmp/$$a > LIBDIR/newsgroups
  1757.       cat >> LIBDIR/newsgroups
  1758.       ;;
  1759.   esac
  1760.   
  1761.   egrep "${group}" LIBDIR/active | sed 's/ .*//' | sort >/tmp/$$active
  1762. ! egrep "${group}" LIBDIR/newsgroups | sed 's/    .*//' | sort >/tmp/$$newsgroups
  1763.   
  1764. ! comm -13 /tmp/$$active /tmp/$$newsgroups >/tmp/$$missing
  1765. ! comm -23 /tmp/$$active /tmp/$$newsgroups >/tmp/$$remove
  1766.   
  1767.   egrep "${group}" LIBDIR/active | sed -n "/m\$/s/ .*//p" |
  1768. !     sort > /tmp/$$active.mod.all
  1769.   egrep "${group}" LIBDIR/newsgroups |
  1770. ! sed -n "/Moderated/s/[     ][     ]*.*//p" | sort > /tmp/$$newsg.mod
  1771.   
  1772. ! comm -12 /tmp/$$missing /tmp/$$newsg.mod >/tmp/$$add.mod
  1773. ! comm -23 /tmp/$$missing /tmp/$$newsg.mod >/tmp/$$add.unmod
  1774.   cat /tmp/$$add.mod /tmp/$$add.unmod >>/tmp/$$add
  1775.   
  1776. ! comm -23 /tmp/$$active.mod.all /tmp/$$remove >/tmp/$$active.mod
  1777. ! comm -13 /tmp/$$newsg.mod /tmp/$$active.mod >/tmp/$$ismod
  1778. ! comm -23 /tmp/$$newsg.mod /tmp/$$active.mod >/tmp/$$notmod.all
  1779. ! comm -23 /tmp/$$notmod.all /tmp/$$add >/tmp/$$notmod
  1780.   
  1781.   if test -s /tmp/$$remove
  1782.   then
  1783. --- 22,51 ----
  1784.       group="^net\\.|^mod\\.|^comp\\.|^sci\\.|^rec\\.|^news\\.|^soc\\.|^misc\\.|^talk\\."
  1785.       egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
  1786.       cat /tmp/$$a > LIBDIR/newsgroups
  1787. +     echo "${line}" >> LIBDIR/newsgroups
  1788.       cat >> LIBDIR/newsgroups
  1789.       ;;
  1790.   esac
  1791.   
  1792.   egrep "${group}" LIBDIR/active | sed 's/ .*//' | sort >/tmp/$$active
  1793. ! egrep "${group}" LIBDIR/newsgroups | sed 's/    .*//' | sort >/tmp/$$newsgrps
  1794.   
  1795. ! comm -13 /tmp/$$active /tmp/$$newsgrps >/tmp/$$missing
  1796. ! comm -23 /tmp/$$active /tmp/$$newsgrps >/tmp/$$remove
  1797.   
  1798.   egrep "${group}" LIBDIR/active | sed -n "/m\$/s/ .*//p" |
  1799. !     sort > /tmp/$$amod.all
  1800.   egrep "${group}" LIBDIR/newsgroups |
  1801. ! sed -n "/Moderated/s/[     ][     ]*.*//p" | sort > /tmp/$$ng.mod
  1802.   
  1803. ! comm -12 /tmp/$$missing /tmp/$$ng.mod >/tmp/$$add.mod
  1804. ! comm -23 /tmp/$$missing /tmp/$$ng.mod >/tmp/$$add.unmod
  1805.   cat /tmp/$$add.mod /tmp/$$add.unmod >>/tmp/$$add
  1806.   
  1807. ! comm -23 /tmp/$$amod.all /tmp/$$remove >/tmp/$$amod
  1808. ! comm -13 /tmp/$$ng.mod /tmp/$$amod >/tmp/$$ismod
  1809. ! comm -23 /tmp/$$ng.mod /tmp/$$amod >/tmp/$$nm.all
  1810. ! comm -23 /tmp/$$nm.all /tmp/$$add >/tmp/$$notmod
  1811.   
  1812.   if test -s /tmp/$$remove
  1813.   then
  1814. ***************
  1815. *** 122,124 ****
  1816. --- 123,126 ----
  1817.   )
  1818.   
  1819.   rm -f /tmp/$$*
  1820. Index: localize.usg
  1821. *** .d/localize.usg    Thu Oct 30 16:12:16 1986
  1822. --- localize.usg    Fri Nov 21 14:05:14 1986
  1823. ***************
  1824. *** 6,11 ****
  1825. --- 6,12 ----
  1826.   g/^#V7 /d
  1827.   g/^#VMS /d
  1828.   g/^#BSD4_[123] /d
  1829. + g/#NOTVMS/s/#NOTVMS.*//
  1830.   g/termlib/s//curses/
  1831.   w
  1832.   q
  1833.  
  1834. Index: localize.sample
  1835. *** .d/localize.sample    Thu Oct 30 16:09:56 1986
  1836. --- localize.sample    Fri Nov 21 14:05:14 1986
  1837. ***************
  1838. *** 7,12 ****
  1839. --- 7,13 ----
  1840.   g/^#BSD4_3 /s///
  1841.   g/^#BSD4_1 /d
  1842.   g/^#USG /d
  1843. + g/#NOTVMS/s/#NOTVMS.*//
  1844.   /^LIBDIR/s;/usr/lib/news;/usr/new/lib/news;
  1845.   /^BINDIR/s;/usr/bin;/usr/new;
  1846.   w
  1847.  
  1848. Index: ifuncs.c
  1849. Prereq: 2.57
  1850. *** .d/ifuncs.c    Thu Oct 30 16:09:04 1986
  1851. --- ifuncs.c    Fri Nov 21 14:05:08 1986
  1852. ***************
  1853. *** 16,26 ****
  1854.    */
  1855.   
  1856.   #ifdef SCCSID
  1857. ! static char    *SccsId = "@(#)ifuncs.c    2.57    10/29/86";
  1858.   #endif /* SCCSID */
  1859.   
  1860.   #include "iparams.h"
  1861. - #include <errno.h>
  1862.   
  1863.   /*LINTLIBRARY*/
  1864.   
  1865. --- 16,25 ----
  1866.    */
  1867.   
  1868.   #ifdef SCCSID
  1869. ! static char    *SccsId = "@(#)ifuncs.c    2.58    11/21/86";
  1870.   #endif /* SCCSID */
  1871.   
  1872.   #include "iparams.h"
  1873.   
  1874.   /*LINTLIBRARY*/
  1875.   
  1876. ***************
  1877. *** 49,54 ****
  1878. --- 48,55 ----
  1879.   static int mccount;
  1880.   #endif /* MULTICAST */
  1881.   
  1882. + long lseek();
  1883.   #ifndef DBM
  1884.   char *histfile();
  1885.   #endif /* !DBM */
  1886. ***************
  1887. *** 106,114 ****
  1888.   #ifdef HIDDENNET
  1889.           if (strncmp(srec.s_name, LOCALSYSNAME, SNLN) == 0)
  1890.               continue;
  1891. ! #endif /* HIDDENNET */
  1892.           if (strncmp(srec.s_name, FULLSYSNAME, SNLN) == 0)
  1893.               continue;
  1894.           if (sptr = srec.s_nosend) {
  1895.               while (*sptr) {
  1896.                   while (*sptr && *sptr != ',')
  1897. --- 107,116 ----
  1898.   #ifdef HIDDENNET
  1899.           if (strncmp(srec.s_name, LOCALSYSNAME, SNLN) == 0)
  1900.               continue;
  1901. ! #else /* !HIDDENNET */
  1902.           if (strncmp(srec.s_name, FULLSYSNAME, SNLN) == 0)
  1903.               continue;
  1904. + #endif /* !HIDDENNET */
  1905.           if (sptr = srec.s_nosend) {
  1906.               while (*sptr) {
  1907.                   while (*sptr && *sptr != ',')
  1908. ***************
  1909. *** 192,203 ****
  1910.                       break;
  1911.                   }
  1912.   #ifdef VMS
  1913. !             if (!transmit(&srec, xfopen(firstbufname,"r"), 1,
  1914. !                 sysptrs, mc))
  1915.   #else /* !VMS */
  1916. !             if (!transmit(&srec, xfopen(ARTICLE,"r"), 1, sysptrs,
  1917. !                 mc))
  1918.   #endif /* !VMS */
  1919.                   continue;
  1920.           }
  1921.   #else /* !MULTICAST */
  1922. --- 194,205 ----
  1923.                       break;
  1924.                   }
  1925.   #ifdef VMS
  1926. !             if (!transmit(&srec, xfopen(firstbufname,"r"),
  1927.   #else /* !VMS */
  1928. !             if (!transmit(&srec, xfopen(ARTICLE,"r"),
  1929.   #endif /* !VMS */
  1930. +                 (strncmp(h.nbuf, "to.", 3) != 0),
  1931. +                 sysptrs, mc))
  1932.                   continue;
  1933.           }
  1934.   #else /* !MULTICAST */
  1935. ***************
  1936. *** 273,281 ****
  1937.       if (notify)
  1938.           appfile = appmsgid = FALSE;
  1939.   
  1940. -     if (!appfile)
  1941. -         appfile = appmsgid;
  1942.       if (local && mode == PROC) {
  1943.           local = 0;
  1944.           while (isdigit(*++ptr))
  1945. --- 275,280 ----
  1946. ***************
  1947. *** 341,347 ****
  1948.               sp->s_name, oldid, hh.ident);
  1949.       }
  1950.   
  1951. !     if (appfile) {
  1952.           if (firstbufname[0] == '\0') {
  1953.               extern char histline[];
  1954.               localize("junk");
  1955. --- 340,346 ----
  1956.               sp->s_name, oldid, hh.ident);
  1957.       }
  1958.   
  1959. !     if (appfile || appmsgid) {
  1960.           if (firstbufname[0] == '\0') {
  1961.               extern char histline[];
  1962.               localize("junk");
  1963. ***************
  1964. *** 444,450 ****
  1965.               argv[++pid] = 0;
  1966.               (void) setgid(gid);
  1967.               (void) setuid(uid);
  1968. !             execv(argv[0], argv);
  1969.               xerror("Can't execv %s", argv[0]);
  1970.           }
  1971.       } else {
  1972. --- 443,449 ----
  1973.               argv[++pid] = 0;
  1974.               (void) setgid(gid);
  1975.               (void) setuid(uid);
  1976. !             execvp(argv[0], argv);
  1977.               xerror("Can't execv %s", argv[0]);
  1978.           }
  1979.       } else {
  1980. ***************
  1981. *** 547,554 ****
  1982.       lhs.dptr = lcident;
  1983.       lhs.dsize = strlen(lhs.dptr) + 1;
  1984.       rhs = fetch(lhs);
  1985. !     if (rhs.dptr)
  1986.           return(TRUE);
  1987.   #else /* !DBM */
  1988.       hfp = xfopen(histfile(lcident), "r");
  1989.       while (fgets(bfr, BUFLEN, hfp) != NULL) {
  1990. --- 546,555 ----
  1991.       lhs.dptr = lcident;
  1992.       lhs.dsize = strlen(lhs.dptr) + 1;
  1993.       rhs = fetch(lhs);
  1994. !     if (rhs.dptr) {
  1995. !         idunlock();
  1996.           return(TRUE);
  1997. +     }
  1998.   #else /* !DBM */
  1999.       hfp = xfopen(histfile(lcident), "r");
  2000.       while (fgets(bfr, BUFLEN, hfp) != NULL) {
  2001. ***************
  2002. *** 612,621 ****
  2003.       rhs.dsize = sizeof fpos;
  2004.       store(lhs, rhs);
  2005.   #else /* !DBM */
  2006. !     /* also append to proper history subfile */
  2007. !     hfp = xfopen(histfile(hline), "a");
  2008. !     fprintf(hfp, "%s\n", hline);
  2009. !     (void) fclose(hfp);
  2010.   #endif /* !DBM */
  2011.       idunlock();
  2012.   }
  2013. --- 613,626 ----
  2014.       rhs.dsize = sizeof fpos;
  2015.       store(lhs, rhs);
  2016.   #else /* !DBM */
  2017. !     if (strcmp(p = histfile(hline), ARTFILE) != 0)
  2018. !     /* If the history subfile is accessible */
  2019. !         if ((hfp = xfopen(p, "a")) != NULL ) { /* If we can append */
  2020. !             fprintf(hfp, "%s\n", hline);   /* Append */
  2021. !             (void) fclose(hfp);
  2022. !         } else
  2023. !             logerr("Unable to append to %s: %s", p, errmsg(errno));
  2024.   #endif /* !DBM */
  2025.       idunlock();
  2026.   }
  2027. ***************
  2028. *** 807,813 ****
  2029.           */
  2030.           if (isproc && index(ngs[ngcount], '.') == NULL &&
  2031.               index(header.nbuf, '.') != NULL) {
  2032. !                 logerr("Local group '%s' removed",
  2033.                       ngs[ngcount]);
  2034.                   continue;
  2035.           }
  2036. --- 812,818 ----
  2037.           */
  2038.           if (isproc && index(ngs[ngcount], '.') == NULL &&
  2039.               index(header.nbuf, '.') != NULL) {
  2040. !                 logerr("Local group %s removed",
  2041.                       ngs[ngcount]);
  2042.                   continue;
  2043.           }
  2044. ***************
  2045. *** 870,878 ****
  2046.               if (uses[i] == 2)
  2047.                   continue;
  2048.               if (isproc)
  2049. !                 cp = "Unknown newsgroup '%s' not localized";
  2050.               else
  2051. !                 cp = "Unknown newsgroup '%s'";
  2052.               logerr(cp, ngs[i]);
  2053.   #ifdef ALWAYSALIAS
  2054.               ++okcount;    /* so we know to exit below */
  2055. --- 875,883 ----
  2056.               if (uses[i] == 2)
  2057.                   continue;
  2058.               if (isproc)
  2059. !                 cp = "Unknown newsgroup %s not localized";
  2060.               else
  2061. !                 cp = "Unknown newsgroup %s";
  2062.               logerr(cp, ngs[i]);
  2063.   #ifdef ALWAYSALIAS
  2064.               ++okcount;    /* so we know to exit below */
  2065. ***************
  2066. *** 902,908 ****
  2067.                   continue;
  2068.               if (strcmp(ngs[i], ngs[j]) != 0)
  2069.                   continue;
  2070. !             logerr("Duplicate '%s' removed", ngs[j]);
  2071.               if (uses[i] < uses[j])
  2072.                   uses[i] = uses[j];
  2073.               uses[j] = 0;
  2074. --- 907,913 ----
  2075.                   continue;
  2076.               if (strcmp(ngs[i], ngs[j]) != 0)
  2077.                   continue;
  2078. !             logerr("Duplicate %s removed", ngs[j]);
  2079.               if (uses[i] < uses[j])
  2080.                   uses[i] = uses[j];
  2081.               uses[j] = 0;
  2082. ***************
  2083. *** 999,1006 ****
  2084.        * the program will die, possibly leaving the lock in place.
  2085.        */
  2086.       if (++numsigs > 100) {
  2087. !         logerr("inews ran away looping on signal %d", n);
  2088. !         xxit(1);
  2089.       }
  2090.       (void) signal(n, onsig);
  2091.       SigTrap = n;
  2092. --- 1004,1010 ----
  2093.        * the program will die, possibly leaving the lock in place.
  2094.        */
  2095.       if (++numsigs > 100) {
  2096. !         xerror("inews ran away looping on signal %d", n);
  2097.       }
  2098.       (void) signal(n, onsig);
  2099.       SigTrap = n;
  2100. ***************
  2101. *** 1085,1091 ****
  2102.       register FILE *ofd;
  2103.       register int c;
  2104.       char *ofdname;
  2105. -     long lseek();
  2106.   
  2107.       /* First try to seek back - if so, it's a cheap way back. */
  2108.       if (lseek(0, 0L, 0) == 0L)
  2109. --- 1089,1094 ----
  2110.  
  2111. Index: patchlevel.h
  2112. *** .d/patchlevel.h    Thu Oct 30 16:09:04 1986
  2113. --- patchlevel.h    Fri Nov 21 14:05:15 1986
  2114. ***************
  2115. *** 1 ****
  2116. ! 0
  2117. --- 1,3 ----
  2118. ! #define    PATCHLEVEL    1
  2119. ! #define NEWS_VERSION   "B 2.11 11/15/86"
  2120.  
  2121. Index: localize.4.3
  2122. *** .d/localize.4.3    Thu Oct 30 16:12:12 1986
  2123. --- localize.4.3    Fri Nov 21 14:05:12 1986
  2124. ***************
  2125. *** 7,12 ****
  2126. --- 7,13 ----
  2127.   g/^#USG /d
  2128.   g/^#VMS /d
  2129.   g/^#BSD4_1 /d
  2130. + g/#NOTVMS/s/#NOTVMS.*//
  2131.   /^UUXFLAGS/s/-r -z/-r -z -n -gd/
  2132.   /^LIBDIR/s;/usr/lib/news;/usr/new/lib/news;
  2133.   /^BINDIR/s;/usr/bin;/usr/new;
  2134.  
  2135. Index: localize.7300
  2136. *** .d/localize.7300    Thu Oct 30 16:12:11 1986
  2137. --- localize.7300    Fri Nov 21 14:05:13 1986
  2138. ***************
  2139. *** 1,4 ****
  2140. ! #From philabs!hhb!kosman!kevin Mon Apr 28 15:56:44 1986
  2141.   rm -f Makefile
  2142.   cp Makefile.dst Makefile
  2143.   chmod u+w Makefile
  2144. --- 1,6 ----
  2145. ! #localize.7300 - for AT&T UNIX PC 7300 and 3b1 system, to use the shared
  2146. ! # library.
  2147. ! #From philabs!hhb!kosman!kevin Sun Nov 9 12:00:17 1986
  2148.   rm -f Makefile
  2149.   cp Makefile.dst Makefile
  2150.   chmod u+w Makefile
  2151. ***************
  2152. *** 8,13 ****
  2153. --- 10,16 ----
  2154.   g/^#V7 /d
  2155.   g/^#VMS /d
  2156.   g/^#BSD4_[123] /d
  2157. + g/#NOTVMS/s/#NOTVMS.*//
  2158.   /CFLAGS[     ]*=/t.
  2159.   .s/CFLAGS/MFLAGS/p
  2160.   .s/-Dindex.*strrchr//p
  2161. ***************
  2162. *** 21,28 ****
  2163.   s/\.c/.o/p
  2164.   /-c compress.c/s/CFLAGS/MFLAGS/p
  2165.   g/$(LFLAGS)/s;$(LFLAGS);& /lib/crt0s.o shlib.ifile;\
  2166. ! s/$(CC)/$(LD)/\
  2167. ! s/-ltermlib //
  2168.   g/chmod 755.*inews/s/755/6755/p
  2169.   /UUXFLAGS =/s/ -z//p
  2170.   w
  2171. --- 24,31 ----
  2172.   s/\.c/.o/p
  2173.   /-c compress.c/s/CFLAGS/MFLAGS/p
  2174.   g/$(LFLAGS)/s;$(LFLAGS);& /lib/crt0s.o shlib.ifile;\
  2175. ! s/$(CC)/$(LD)/
  2176. ! g/-ltermlib/s/-ltermlib//
  2177.   g/chmod 755.*inews/s/755/6755/p
  2178.   /UUXFLAGS =/s/ -z//p
  2179.   w
  2180. ***************
  2181. *** 37,43 ****
  2182.   /DFLTSUB/s/".*"/"all"/p
  2183.   /ROOTID/s/10/101/p
  2184.   /TMAIL/s;^;/*;p
  2185. ! /PAGE/s;/usr/ucb/more;/usr/bin/less;p
  2186.   /DFTXMIT/s/ -z//p
  2187.   /UXMIT/s/ -z//p
  2188.   /UNAME/s;/\* ;;p
  2189. --- 40,46 ----
  2190.   /DFLTSUB/s/".*"/"all"/p
  2191.   /ROOTID/s/10/101/p
  2192.   /TMAIL/s;^;/*;p
  2193. ! /PAGE/s;/usr/ucb/more;/usr/bin/more;p
  2194.   /DFTXMIT/s/ -z//p
  2195.   /UXMIT/s/ -z//p
  2196.   /UNAME/s;/\* ;;p
  2197. ***************
  2198. *** 47,52 ****
  2199. --- 50,60 ----
  2200.   q
  2201.   EOF
  2202.   
  2203. + #  specific stuff to tailor the shared-libarary ifile.  The news software
  2204. + #  duplicates some code in the shared library and its easiest just to avoid
  2205. + #  the error messages.  Also, the ifile for some reason does not define
  2206. + #  daylight (from ctime(3c)) -- as near as I can tell, this is where it goes.
  2207.   rm -f shlib.ifile
  2208.   cat /lib/shlib.ifile >shlib.ifile
  2209.   chmod u+w shlib.ifile
  2210. ***************
  2211. *** 58,61 ****
  2212. --- 66,75 ----
  2213.   /^ospeed /d
  2214.   /^COLS /d
  2215.   /^_sibuf /i
  2216. + daylight = 0x303658;
  2217. + .
  2218. + w
  2219. + q
  2220.   EOF
  2221.  
  2222. Index: header.c
  2223. Prereq: 2.43
  2224. *** .d/header.c    Thu Oct 30 16:10:09 1986
  2225. --- header.c    Fri Nov 21 16:16:00 1986
  2226. ***************
  2227. *** 16,26 ****
  2228.    */
  2229.   
  2230.   #ifdef SCCSID
  2231. ! static char    *SccsId = "@(#)header.c    2.43    10/23/86";
  2232.   #endif /* SCCSID */
  2233.   
  2234.   #include <stdio.h>
  2235.   #include "params.h"
  2236.   
  2237.   char *hfgets();
  2238.   
  2239. --- 16,27 ----
  2240.    */
  2241.   
  2242.   #ifdef SCCSID
  2243. ! static char    *SccsId = "@(#)header.c    2.44    11/21/86";
  2244.   #endif /* SCCSID */
  2245.   
  2246.   #include <stdio.h>
  2247.   #include "params.h"
  2248. + #include "patchlevel.h"
  2249.   
  2250.   char *hfgets();
  2251.   
  2252. /* End of text from mirror:news.software.b */
  2253.